#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#define DEFAULT_SZ 3
#define MAX_NAME 10
#define MAX_SEX  10
#define MAX_TELE 13
#define MAX_ADDR 20


enum num
{
	EXIT,
	ADD,
	DEL,
	SEARCH,
	MODIFY,
	SHOW,
	SORT,
	SAVE
};

typedef struct PeoInfo
{
	char name[MAX_NAME];
	int age;
	char sex[MAX_SEX];
	char tele[MAX_TELE];
	char addr[MAX_ADDR];

}PeoInfo;

typedef struct Contact
{
	PeoInfo* data;
	int size;
	int capacity;
}Contact;

void InitContact(Contact* ps);

void AddContact(Contact* ps);

void ShowContact(Contact* ps);

void SearchContact(Contact* ps);

void DelContact(Contact* ps);

void ModifyContact(Contact* ps);

void SortContact(Contact* ps);

void DestroyContact(Contact* ps);

void SaveContact(Contact* ps);

void LoadContact(Contact* ps);